package cn.qn.common.configs;

import cn.qn.common.filter.JwtFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by nishu on 2018/4/17.
 */
@Configuration
public class JwtFilterConfig {
    @Bean
    public FilterRegistrationBean jwtFilter() {
        final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new JwtFilter());
        registrationBean.addInitParameter("exclusions","*.js");
        registrationBean.addUrlPatterns("/**/*");
        return registrationBean;
    }
}
